<?php defined('In33hao') or exit('Access Invalid!'); ?>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>分销管理</h3>
                <h5>分销规则操作</h5>
            </div>

            <ul class="tab-base nc-row">
                <li>
                    <a href="index.php?act=fenxiao&op=index">
                        <span>会员分销规则</span>
                    </a>
                </li>
                <li>
                    <a href="index.php?act=fenxiao&op=store">
                        <span>小店分销规则</span>
                    </a>
                </li>
<!--                <li>-->
<!--                    <a href="JavaScript:void(0);" class="current">-->
<!--                        <span>商圈分销规则</span>-->
<!--                    </a>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <a href="index.php?act=fenxiao&op=agent">-->
<!--                        <span>代理分销规则</span>-->
<!--                    </a>-->
<!--                </li>-->
            </ul>
        </div>
    </div>
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span></div>
        <ul>
            <li>在这里可以设置商圈分销比例</li>
        </ul>
    </div>
    <form method="post" id="db_form">
        <input type="hidden" name="form_submit" value="ok"/>
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">消费者佣金比例</dt>
                <dd class="opt">
                    <input type="text" id="fx_sq_hy" value="<?php echo $output['list_setting']['fx_sq_hy']; ?>" name="fx_sq_hy" class="w60"> ％
                    <p class="notic">消费者佣金 = 商品利润 * 消费者佣金比例</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">推荐人一级佣金比例</dt>
                <dd class="opt">
                    <input type="text" id="fx_sq_hy_one" value="<?php echo $output['list_setting']['fx_sq_hy_one']; ?>" name="fx_sq_hy_one" class="w60"> ％
                    <p class="notic">推荐人一级佣金 = 商品利润 * 推荐人一级佣金比例</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">推荐人二级佣金比例</dt>
                <dd class="opt">
                    <input type="text" id="fx_sq_hy_two" value="<?php echo $output['list_setting']['fx_sq_hy_two']; ?>" name="fx_sq_hy_two" class="w60"> ％
                    <p class="notic">推荐人二级佣金 = 商品利润 * 推荐人二级佣金比例</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">推荐商户一级佣金比例</dt>
                <dd class="opt">
                    <input type="text" id="fx_sq_sh_one" value="<?php echo $output['list_setting']['fx_sq_sh_one']; ?>" name="fx_sq_sh_one" class="w60"> ％
                    <p class="notic">推荐商户一级佣金 = 商品利润 * 推荐商户一级佣金比例</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">推荐商户二级佣金比例</dt>
                <dd class="opt">
                    <input type="text" id="fx_sq_sh_two" value="<?php echo $output['list_setting']['fx_sq_sh_two']; ?>" name="fx_sq_sh_two" class="w60"> ％
                    <p class="notic">推荐商户二级佣金 = 商品利润 * 推荐商户一级佣金比例</p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green"
                                id="btn"><?php echo $lang['nc_submit']; ?></a></div>
        </div>
    </form>
</div>
<script>
    $(document).ready(function () {
        $('#btn').click(function () {
            var fx_sq_hy = $("#fx_sq_hy").val();
            var fx_sq_hy_one = $("#fx_sq_hy_one").val();
            var fx_sq_hy_two = $("#fx_sq_hy_two").val();
            var fx_sq_sh_one = $("#fx_sq_sh_one").val();
            var fx_sq_sh_two = $("#fx_sq_sh_two").val();
            if (isNaN(fx_sq_hy) || fx_sq_hy == 'undefined' || fx_sq_hy == '' || fx_sq_hy < 0) {
                alert('消费者佣金比例必须是不小于0的纯数字');
                return ;
            }
            if (isNaN(fx_sq_hy_one) || fx_sq_hy_one == 'undefined' || fx_sq_hy_one == '' || fx_sq_hy_one < 0) {
                alert('推荐人一级佣金比例必须是不小于0的纯数字');
                return ;
            }
            if (isNaN(fx_sq_hy_two) || fx_sq_hy_two == 'undefined' || fx_sq_hy_two == '' || fx_sq_hy_two < 0) {
                alert('推荐人二级佣金比例必须是不小于0的纯数字');
                return ;
            }
            if (isNaN(fx_sq_sh_one) || fx_sq_sh_one == 'undefined' || fx_sq_sh_one == '' || fx_sq_sh_one < 0) {
                alert('推荐商户一级佣金比例必须是不小于0的纯数字');
                return ;
            }
            if (isNaN(fx_sq_sh_two) || fx_sq_sh_two == 'undefined' || fx_sq_sh_two == '' || fx_sq_sh_two < 0) {
                alert('推荐商户二级佣金比例必须是不小于0的纯数字');
                return ;
            }
            $("#db_form").submit();
        });
    });
</script>